﻿using System;
using System.Collections.Generic;
using Gameplay.PVE.Utils;
using UnityEngine;
using XLua;
using Yoozoo.Framework.Core;

namespace Gameplay.PVE.Survivor
{
    public class EffectConfig
    {
        public int id;
        public int res_id_h;
        public List<int> children;
        public int follow_animation;
        public List<float> position_offset_min;
        public List<float> position_offset_max;
        public int set_parent;
        public int parent_index;
        public float scale_min;
        public float scale_max;
        public int use_parent_forward;
        public int life_time_type;
        public float life_time;
        public int ground_effect;
        public string sound_name;
    }
    
    public partial class BattleConfigManager
    {
        private Dictionary<int, EffectConfig> effectMap;
        public EffectConfig GetEffectConfig(int id)
        {
            if (effectMap.TryGetValue(id,out var config))
            {
                return config;
            }
            UnityEngine.Debug.LogError("特效配置找不到" + id);
            return null;
        }
        public static void PreloadEffectConfig(LuaTable table)
        {
            PveUtils.PreloadRpgConfig(table,ref Instance.effectMap);
        }
    }
}
